

import 'package:oral_cloud/config/app_config.dart';
import 'package:oral_cloud/model/patient.dart';
import 'package:oral_cloud/model/patient_list.dart';
import 'package:oral_cloud/provider/view_state_refresh_list_model.dart';
import 'package:oral_cloud/service/oral_repository.dart';

class PatientModel extends ViewStateRefreshListModel {
  final String token;
  PatientModel(this.token){
    pageSize=AppConfig.isPad?6:10;
  }

  @override
  Future<List<Patient>> loadData({int pageNum}) async {
    print('PatientModel----->loadData pageNum=$pageNum');
    PatientList patientList=await OralRepository.fetchPatientList(token,page:pageNum,count:pageSize);
    total=patientList.total;
    return patientList.patients;
  }
}

